
import { createApp } from 'vue' 
import App from './App.vue'

import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'; 
import locale from 'element-plus/dist/locale/zh-cn.mjs'
import * as Icons from '@element-plus/icons-vue';//导入所有element icon图标

// 格式化样式
import '@/assets/styles/index.scss'
// 导入数据状态管理模块
import pinia from './store';
// 挂载
const app = createApp(App)
.use(router)
.use(ElementPlus,{locale})
.use(pinia)
// 注册全局组件 icon
Object.keys(Icons).forEach((key) => {//循环遍历组件名称
    if ("Menu" !== key) {//如果不是图标组件不是Menu，就跳过，否则加上ICon的后缀
        app.component(key, Icons[key]);
    } else {
        app.component(key + "Icon", Icons[key]);
    }
}); 

app.mount('#app')
